﻿using IService;
using Microsoft.AspNetCore.Mvc;

namespace WMS.Controllers
{
    public class WarehousingManagmentController : Controller
    {
        private readonly IDictService _dictService;

        public WarehousingManagmentController(IDictService dictService)
        {
            _dictService = dictService; // 依赖注入公共组件的服务
        }
        public async Task<IActionResult> Index()
        {
            //获取入库类型
            var dictTypeForStockInType = await _dictService.GetDictTypeAsync("sys_stockin_type");
            if (dictTypeForStockInType != null)
            {
                var stockInTypeStatusList = await _dictService.GetDictDataListAsync(dictTypeForStockInType.DictTypeId);
                ViewBag.StockInTypeStatusList = stockInTypeStatusList;
            }

            //获取单据状态
            var dictTypeForOrderStatu = await _dictService.GetDictTypeAsync("sys_order_statu");
            if (dictTypeForOrderStatu != null)
            {
                var orderStatusList = await _dictService.GetDictDataListAsync(dictTypeForOrderStatu.DictTypeId);
                ViewBag.OrderStatusList = orderStatusList;
            }
            return View(); 
        }
    }
}
